const app = getApp();
var WxParse = require('../../wxParse/wxParse.js');

Page({
	data: {
		htmlUrl: '',
		title: '',
		time: ''
	},
	onLoad(ob) {
		let newsId = ob.newsId;
		app.util.request({
			url: 'entry/wxapp/NewsDetail',
			data: {
				newsid: newsId
			},
			success: (res) => {
				console.log(res.data.data)

				this.setData({title: res.data.data.news.title})
				this.setData({time: res.data.data.news.publishtime})

				//解析富文本
				let article = res.data.data.news.detail
				var that = this;
				WxParse.wxParse('article', 'html', article, that, 5);
			}
		})
	}
})